<!-- 课程搜索 -->
<div id="JwapSearch" class="m-search-pnl">
<div id="JwsClose">取消</div>
<div class="ysearch-box">
<form method="post" name="f1" action="{dede:global.mcfg_basehost/}/search.php" onsubmit="return checkSearchForm()">
<input type="hidden" name="kwtype" value="0" />
<input type="hidden" id="driverId" name="channeltype" value="17" />  
<input type="search" class="yfixtext" id="search" name="keyword" placeholder="搜索你感兴趣的课程" autocomplete="off">
<input type="submit" class="fixsbmt" value="">
</form>
</div>
</div>
<!-- 课程搜索 End -->
<script type="text/javascript">
  function checkSearchForm(){
  if(document.getElementById('search').value){
    return true;
    }else{
   alert("请输入课程关键字");
    return false;
    }
    }
</script>
<script>
(function(){var searchWrapObj=document.getElementById("JwapSearch");searchWrapObj&&document.body.appendChild(searchWrapObj);var sentFlag=false;var submitFlag=false;if(-1==window.location.pathname.indexOf("bbs")){showSeriesViewed()}function showSeriesViewed(){var COOKIE_NAME="LAST_VIEW_CHEXIS";var cookieValue=decodeURI(decodeURIComponent(document.cookie.replace(new RegExp(".*(?:^|; )"+COOKIE_NAME+"=([^;]*).*|.*"),"$1")));var historyObj=document.getElementById("JviewHistory");if(!cookieValue||!historyObj){return}var valueArr=cookieValue.split(",");var html="";for(var i=0;i<valueArr.length&&i<3;i++){var data=valueArr[i].split("-");if(data.length<2){continue}html+=''+data[0]+'/">'+data[1]+"</a>"}if(""!=html){historyObj.innerHTML=""+html;historyObj.style.display="block"}}var SHOW_PANNEL_CLASS="m-full-pnl";var DISABLE_SCROLL_CLASS="m-disb-scroll";var htmlObj=document.documentElement;function hasClass(el,className){if(el.classList){return el.classList.contains(className)}return !!el.className.match(new RegExp("(\\s|^)"+className+"(\\s|$)"))}function addClass(el,className){if(el.classList){el.classList.add(className)}else{!hasClass(el,className)&&(el.className+=" "+className)}}function rmvClass(el,className){if(el.classList){el.classList.remove(className)}else{hasClass(el,className)&&(el.className=el.className.replace(new RegExp("(\\s|^)"+className+"(\\s|$)")," "))}}var enIptObj=document.getElementById("JenIpt");var iptObj=document.getElementById("JwsIpt");enIptObj&&enIptObj.addEventListener("click",function(){if(-1==window.location.pathname.indexOf("bbs")){getHotSeries()}loadSearchJS();htmlObj.setAttribute("data-y",document.body.scrollTop);addClass(htmlObj,SHOW_PANNEL_CLASS);searchWrapObj&&(searchWrapObj.scrollIntoView());addClass(htmlObj,DISABLE_SCROLL_CLASS);var tmpIptObj=document.search&&document.search.q;if(tmpIptObj){tmpIptObj.value="";tmpIptObj.focus()}loadLike()});var closeObj=document.getElementById("JwsClose");closeObj&&closeObj.addEventListener("click",function(){iptObj&&enIptObj&&(enIptObj.value=iptObj.value);rmvClass(htmlObj,DISABLE_SCROLL_CLASS);var setY=htmlObj.getAttribute("data-y");setY&&(document.body.scrollTop=setY);rmvClass(htmlObj,SHOW_PANNEL_CLASS)});var enSubmitObj=document.getElementById("JenSubmit");enSubmitObj&&enSubmitObj.addEventListener("click",clickBtnSubmit);var submitObj=document.getElementById("JwsSubmit");submitObj&&submitObj.addEventListener("click",clickBtnSubmit);function clickBtnSubmit(){submitFlag=true;if("function"!=typeof wapSearchSubmit){loadSearchJS();return false}wapSearchSubmit()}function loadSearchJS(){if(sentFlag){return}sentFlag=true;var scriptObj=document.createElement("script");scriptObj.src="";scriptObj.charset="utf-8";var headObj=document.getElementsByTagName("head")[0];headObj.appendChild(scriptObj);scriptObj.onload=scriptObj.onreadystatechange=function(){var f=scriptObj.readyState;if(f&&f!="loaded"&&f!="complete"){return}scriptObj.onload=scriptObj.onreadystatechange=null;ks_search();if(submitFlag){wapSearchSubmit()}}}function getHotSeries(){var hotSeriesObj=document.getElementById("JhotSeries");var record=localStorage.getItem("wapSearchRecord");if(record!=null||!hotSeriesObj){return}loadScript(location.protocol+"",function(data){var html="";var seriesArr=data.data;if(seriesArr.length<0){return}for(var i=0,len=seriesArr.length;i<len;i++){var result=seriesArr[i];html+=''+result.id+'/" title="'+result.title+'">'+result.title+"</a>"}if(""!=html){hotSeriesObj.innerHTML=""+''+html+"";hotSeriesObj.style.display="block"}},"showHotseries")}function getParam(url,name){if(!url||!name){return}var name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)");var results=regex.exec(url);return(null==results?null:results[1])}function loadScript(url,fn,callbackName,charset){var cbName=getParam(url,"jsCallBack");var callbackName=cbName||callbackName;var cb=cbName||!callbackName?"":"jsCallBack="+callbackName;var pos=url.indexOf("?")+1;if(cb){url=0==pos?(url+"?"+cb):(url.substring(pos,-1)+cb+"&"+url.substring(pos))}if("function"==typeof fn&&callbackName){window[callbackName]=fn}var headElm=document.getElementsByTagName("head")[0];var scriptElm=document.createElement("script");scriptElm.src=url;if(charset){scriptElm.charset=charset}headElm.appendChild(scriptElm);scriptElm.onload=scriptElm.onreadystatechange=function(){var f=scriptElm.readyState;if(f&&f!="loaded"&&f!="complete"){return}if("function"==typeof fn&&!cb){fn()}if(!cbName&&window[callbackName]){delete window[callbackName]}scriptElm.onload=scriptElm.onreadystatechange=null;headElm.removeChild(scriptElm)}}function getCookie(d){var b=d+"=";var a=document.cookie.split(";");for(var e=0;e<a.length;e++){var f=a[e];while(f.charAt(0)==" "){f=f.substring(1)
}if(f.indexOf(b)!=-1){return f.substring(b.length,f.length)}}return""}var allPage=1;var changePage=1;var likeSerials=[];function loadLike(){var uValue=getCookie("u");var html="";loadJS("",function(){loadJS("",function(){Locate.defaultData={};LocateAuto.defaultData={proId:5,cityId:1,url:""};LocateAuto.init({callback:function(data){var cityId=data.cityId;$.ajax({url:"",data:{uid:uValue,cityId:cityId},dataType:"jsonp",success:function(res){likeSerials=res;allPage=Math.ceil(res.length/8);for(var i=0;i<8;i++)document.getElementById("JwsLike").innerHTML=html}})}})},"utf-8")},"utf-8")}document.getElementById("JwsChange").onclick=function(){var html="";{var len=changePage*8;for(var i=(changePage-1)*8;i<len;i++){if(likeSerials[i]){html+=''}}document.getElementById("JwsLike").innerHTML=html}};iptObj.addEventListener("blur",function(e){!iptObj.value&&(iptObj.value=quotes[Math.floor(Math.random()*quotes.length)])})})();</script>
<!-- 课程搜索 End -->